package net.tarine.gastronomi.client.services;

import java.util.List;

import net.tarine.gastronomi.shared.AppConst;
import net.tarine.gastronomi.shared.DatabaseException;
import net.tarine.gastronomi.shared.EmptyResultException;
import net.tarine.gastronomi.shared.ValidationException;
import net.tarine.gastronomi.shared.to.GasTo;
import net.tarine.gastronomi.shared.to.GasUserTo;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath(AppConst.SERVICE_USER)
public interface GasService extends RemoteService {
	//GasUserTo
	List<GasUserTo> findGasUsers(Integer offset, Integer pageSize) throws DatabaseException, EmptyResultException;
	GasUserTo findGasUserById(String id) throws DatabaseException, EmptyResultException;
	GasUserTo findGasUserFromSession() throws DatabaseException, EmptyResultException, ValidationException;//finds a User by the google internal id
	GasUserTo persistGasUser(GasUserTo to) throws DatabaseException;
	List<GasUserTo> deleteGasUser(String id) throws DatabaseException, EmptyResultException;
	
	//GasTo
	GasTo findGas() throws DatabaseException;
	GasTo persistGas(GasTo to) throws DatabaseException;
	
	//login-logout URLs
	String createLoginUrl(String destinationUrl) throws EmptyResultException;
	String createLogoutUrl(String destinationUrl) throws EmptyResultException;
}
